﻿<UserControl x:Class="AtletIS.Shared.WpfControls.ChipResults"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="800" xmlns:my="clr-namespace:AtletIS.Shared.WpfControls" Loaded="UserControl_Loaded">
    <Grid>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="590"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="80" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="50" />
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <my:HeaderBox
            Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" 
            x:Name="cbTitle" />

        <DataGrid
            Grid.Column="1" Grid.Row="2" Margin="5"
            FontSize="16" Height="360"
            BorderThickness="1" BorderBrush="SteelBlue"
            AutoGenerateColumns="False" Foreground="SteelBlue"
            Name="dgCheckPoints" IsReadOnly="True"
            AlternatingRowBackground="Gainsboro" 
            CanUserResizeRows="False" CanUserResizeColumns="False" CanUserReorderColumns="False" 
            CanUserSortColumns="False" HorizontalGridLinesBrush="Gainsboro" VerticalGridLinesBrush="Gainsboro" RowHeaderWidth="0" CanUserDeleteRows="True" CanUserAddRows="False" SelectionMode="Single" SelectionChanged="dgCheckPoints_SelectionChanged" Focusable="False">

            <DataGrid.Columns>
                <DataGridTextColumn Header="Check-points" Binding="{Binding Path=Name}" Width="*" />
            </DataGrid.Columns>

            <DataGrid.CellStyle>
                <Style TargetType="DataGridCell">
                    <Setter Property="Padding" Value="10,15"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type DataGridCell}">
                                <Border Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                                    <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="IsSelected"
                        Value="True">
                            <Setter Property="BorderThickness" Value="0" />
                            <Setter Property="Background" Value="LightSteelBlue" />
                            <Setter Property="Foreground" Value="SteelBlue" />
                            <Setter Property="FontWeight" Value="Bold" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </DataGrid.CellStyle>

        </DataGrid>

        <!-- LIST -->
        <ItemsControl
            Grid.Column="2" 
            Grid.Row="2"
            Width="590"
            MinHeight="50"
            HorizontalAlignment="Left"
            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
            Name="lbResults"
            BorderThickness="0" Focusable="False">

            <ItemsControl.Background>
                <SolidColorBrush />
            </ItemsControl.Background>

        </ItemsControl>

        <my:FooterBox 
            Grid.Column="1" Grid.ColumnSpan="2" 
            Grid.Row="3" 
            x:Name="footer" />

        <StackPanel
            Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="4"
            Orientation="Horizontal"  HorizontalAlignment="Right">

            <Button
                Margin="30,5,5,5" Content="_Prev" Click="btnPrev_Click"
                Width="100px" HorizontalAlignment="Left" FontSize="18"
                BorderThickness="1" BorderBrush="SteelBlue" Background="White" Foreground="SteelBlue" Focusable="False" />

            <Button
                Margin="5,5,30,5" Content="_Next" Click="btnNext_Click"
                Width="100px" HorizontalAlignment="Right" FontSize="18"
                BorderThickness="1" BorderBrush="SteelBlue" Background="White" Foreground="SteelBlue" Focusable="False" />

        </StackPanel>

    </Grid>
</UserControl>
